﻿<%@ Page Language="C#"  MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Nivdal.TeamSponsorshipDetails" Title=""
    StylesheetTheme="SkinFile" Codebehind="TeamSponsorshipDetails.aspx.cs" %>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, TeamSponsorshipDetails_PageNameLabel %>" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="basic_element">
    <div class="red_title"></div>
    <div class="padding5">
        <asp:Label ID="Message" runat="server" Text="" SkinID="RedSmallHeaderLabel"></asp:Label>
        <asp:FormView ID="FormView1" runat="server" DataSourceID="GetTeamSponsorDetails">
            <ItemTemplate>
                <asp:Label ID="SponsorTitleLabel" runat="server" Text="<%$ Resources:Resource, TeamSponsorshipDetails_SponsorTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                <asp:Label ID="SponsorNameLabel" runat="server" Text='<%# Bind("SponsorName")%>' SkinID="TeamNameLabel" />
                <br />
                <asp:HyperLink ID="SponsorLinkHyperLink" runat="server" ImageUrl='<%# Bind("SponsorImage") %>'
                    NavigateUrl='<%#Eval("SponsorLink") %>' Target="_blank"></asp:HyperLink>
                <br />
                <asp:Label ID="ContractExpiresTitleLabel" runat="server" Text="<%$ Resources:Resource, TeamSponsorshipDetails_ContractExpiresTitleLabel %>"
                    SkinID="InfoLabel"></asp:Label>
                <asp:Label ID="ContractExpiresLabel" runat="server" Text='<%# Bind("ContractExpires")%>' SkinID="InfoLabel" />
                <br />
                <asp:Label ID="ContractSumTitleLabel" runat="server" Text="<%$ Resources:Resource, TeamSponsorshipDetails_ContractSumTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                <asp:Label ID="ContractSumLabel" runat="server" Text='<%# int.Parse(Eval("ContractSum").ToString()).ToString("N0") %>' SkinID="InfoLabel" />
            </ItemTemplate>
        </asp:FormView>     
    </div>
    </div>
    
    <asp:Panel ID="SuggestionsPanel" runat="server">  
        <div class="basic_element">
        <div class="red_title">
            <asp:FormView ID="SuggestionsSumAndDateFormView" runat="server" DataSourceID="SuggestionsSumAndDateSataSource" >
            <ItemTemplate>
                <asp:Label ID="SuggestionSumAndDateLabel" runat="server" SkinID="GridLabel"
                Text='<%# SponsorshipSuggestionsLabelText(Eval("ContractSum").ToString(), Eval("EndTime").ToString(), Eval("ContractStatus").ToString())%>' ></asp:Label>
            </ItemTemplate>
        </asp:FormView>
        </div>
        <div class="padding5">
        
            
            <asp:GridView ID="SponsorshipProposalsGridView" runat="server" DataSourceID="SponsorshipProposalsSqlDataSource" OnRowCommand="Accept"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="false" EnableTheming="True">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HyperLink ID="SponsorLinkHyperLink" runat="server" ImageUrl='<%# Bind("SponsorImage") %>'
                                NavigateUrl='<%#Eval("SponsorLink") %>' Target="_blank" ToolTip='<%# Eval("SponsorName") %>' ></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="AcceptLinkButton" runat="server" CommandArgument='<%# Eval("ProposalId") %>' CommandName="AcceptSponsor"
                             SkinID="GridLinkButton" Visible='<%# StatusString(Eval("Status"))%>'
                             Text="<%$ Resources:Resource, Friends_AcceptLinkButtonText %>"  OnClientClick='<%# AcceptLinkButtonOnClientClick(Eval("SponsorName").ToString())%>'></asp:LinkButton>
                            <asp:Label ID="AcceptedLabel" runat="server" Text="<%$ Resources:Resource, TeamSponsorshipDetails_AcceptedLabel %>" 
                            Visible='<%# !StatusString(Eval("Status"))%>' SkinID="GridLabel" ></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <asp:Label ID="NoNnewponsorshipLabel" runat="server" Text="<%$ Resources:Resource, TeamSponsorshipDetails_NoNnewponsorshipLabel %>"></asp:Label>
                </EmptyDataTemplate>
            </asp:GridView>
        </div>
        </div>
    </asp:Panel>
    <asp:SqlDataSource ID="SuggestionsSumAndDateSataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="Nivdal_GetTeamSponsorSuggestionSum" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
    <asp:SqlDataSource ID="GetTeamSponsorDetails" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetTeamSponsorDetails" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SponsorshipProposalsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetSponsorshipProposals" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
</asp:Content>
